<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .div1,.div2,.div3{
            width: 100px;
            height: 100px;
        }
        .div1{
            background-color: blue;
        }
        .div2{
            background-color: red;
            position: absolute;
            /* 父元素如果有定位  则会相对于父元素 */
            left: 100px;
        }
        .div3{
            background-color: green;
        }
        .outer{
            position: relative;
            left: 100px;
        }
    </style>
</head>
<body>
    <div class="outer">
        <div class="div1"></div>
        <div class="div2"></div>
        <div class="div3"></div>
    </div>
</body>
</html>